
<%@ page import="ratemymacclass.Course" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'course.label', default: 'Course')}" />
        <title><g:message code="default.show.label" args="[entityName]" /></title>
    </head>
    <body>
        <div id="header" style="margin-left: 15px">
            <br/><h1>${courseInstance?.department} ${courseInstance?.courseNum}: ${courseInstance?.title}</h1><br />
        </div>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
            <span class="menuButton"><g:link class="list" action="list">List of Courses</g:link></span>
            <span class="menuButton"><g:link controller="professor" class="list" action="list">List of Professors</g:link></span>
            <span class="menuButton"><g:link controller="rating" class="create" action="create">Rate this course</g:link></span>
        </div>
        <div class="body"><br />
            <div class="dialog">
                <table>
                    <tbody>
                        <tr class="prop">
                            <td valign="top" class="name"><h3>Ratings for ${courseInstance?.title}</h3></td>
                        </tr><tr>
                            <td valign="top" style="text-align: left;" class="value">
                                <ul>
                                <g:each in="${courseInstance.ratings}" var="r">
                                    <li><g:link controller="rating" action="show" id="${r.title}">${r?.encodeAsHTML()}</g:link></li>
                                </g:each>
                                </ul>
                            </td>

                        </tr>

                    </tbody>
                </table>
            </div>
            <div class="buttons">
                <g:form>
                    <g:hiddenField name="id" value="${courseInstance?.id}" />
                    <span class="button"><g:actionSubmit class="edit" action="edit" value="${message(code: 'default.button.edit.label', default: 'Edit')}" /></span>
                    <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
                </g:form>
            </div>
        </div>
    </body>
</html>
